#ifndef _RELAYMOTOR_H_
#define _RELAYMOTOR_H_
#include "stdint.h"
#include "stm32f4xx.h"



#define POS        1
#define NEG        0
/****************RELAY*******************/

#define AXIS_CLK         RCC_AHB1Periph_GPIOE
#define AXIS_PORT        GPIOE
#define AXIS_PIN         GPIO_Pin_8

#define CHARGE_CLK        RCC_AHB1Periph_GPIOE
#define CHARGE_PORT       GPIOE
#define CHARGE_PIN        GPIO_Pin_9


typedef struct
{
	GPIO_TypeDef* GPIOx;
	uint16_t      GPIO_Pin;
  uint8_t       Polarity;
}GPIO_OUT_t;



typedef enum
{
	CLOSE = 0,
	OPEN  = 1,
    TOG   = 2,	
}E_RELAY_STATE;



//typedef enum
//{
//	CHARGE = 0,
//	FAN  = 1,
//    AXIS  = 2,
//}E_AXIS_STATE;

typedef enum
{
	CHARGE_RELAY = 0,
    AXIS_RELAY  = 1,
    FAN_RELAY = 0,
}E_RELAY_USE;


extern GPIO_OUT_t RELAY_OUT[2];

void Relay_Gpio_Init(void);
void RelayInit(void);
void GPIO_Out(GPIO_OUT_t *RelayOut,uint8_t RelayState);
#endif

